package org.sky.cloud.common.http.request;

import org.sky.cloud.common.http.Callback;
import org.sky.cloud.common.http.handler.ResponseHandler;
import org.sky.cloud.common.model.RequestHttpEntity;

import java.io.Closeable;
import java.net.URI;


public interface AsyncHttpClientRequest extends Closeable {
    
    
    /**
     * execute async http request.
     *
     * @param uri               http url
     * @param httpMethod        http request method
     * @param requestHttpEntity http request entity
     * @param responseHandler   http response handler
     * @param callback          http response callback
     * @throws Exception ex
     */
    <T> void execute(URI uri, String httpMethod, RequestHttpEntity requestHttpEntity,
                     final ResponseHandler<T> responseHandler, final Callback<T> callback) throws Exception;
}
